﻿using Autofac;
using System.Reflection;
using Travel.CommonUtil.Snowflake;
using Module = Autofac.Module;

namespace Travel.API
{
    public class AutofacModuleRegister:Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            // 批量注册服务
            builder.RegisterAssemblyTypes(Assembly.Load("Travel.Service"))
            .Where(a => a.Name.EndsWith("Service")).AsImplementedInterfaces();
        }
    }
}
